/* ************************************************************************

   Copyright:

   License:

   Authors: SALMON Charles

************************************************************************ */

qx.Class.define("bip.services.QuestionService",
{
  extend : bip.services.AbstractService,
  
  construct : function(url, delegate)
  {
    this.base(arguments);
    this._store.bind("model", this, "question");
  },
  
  properties : {
    question : {
      nullable: true,
      event: "changeQuestion"
    }
  },
  

  members :
  {

    postQuestion : function(topic) {
    	this._store.setUrl(null);
    	this._store.setModel(this.getQuestion());
    	this._store.setUrl("questions/createQuestion");
    },
    
    removeQuestion : function(question) {
    	this._store.setUrl(null);
    	this._store.setModel(question);
    	this._store.setUrl("questions/removeQuestion");
    }
  }
});